import { EnemyManager } from "../common/EnemyManager"
import { ILevel, ISpikes, ITile } from "../Levels"
import { BurstManager } from "../Scripts/Burst/BurstManager"
import { DoorManager } from "../Scripts/Door/DoorManager"
import { PlayerManager } from "../Scripts/Player/PlayerManager"
import { SmokeManager } from "../Scripts/Smoke/SmokeManager"
import { TileItem } from "../Scripts/Tile/TileItem"

export class DataManager{

  mapInfo: Array<Array<ITile>>
  mapRowCount: number
  mapColumnCount: number
  level: number = 1
  tiles: Array<Array<TileItem>>
  player: PlayerManager
  enemys: Array<EnemyManager>
  door: DoorManager
  spikes: Array<ISpikes>
  bursts: Array<BurstManager>
  smokes: Array<SmokeManager>
  records: Omit<ILevel, 'mapInfo'>[]

  private static instance: DataManager

  static getInstance(): DataManager {
    return this.instance || (this.instance = new DataManager())
  }

  static resetData() {
    const instance = DataManager.getInstance()
    instance.mapInfo = []
    instance.mapRowCount = 0
    instance.mapColumnCount = 0
    instance.tiles = []
    instance.enemys = []
    instance.door = null
    instance.bursts = []
    instance.smokes = []
    instance.spikes = []
    instance.records = []

  }

}
